﻿// JSON C# Class Generator
// http://at-my-window.blogspot.com/?page=json-class-generator

using System;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json;

namespace Sina.Altman.Weibo.SDK.Objects
{
    /// <summary>
    /// 存储Access Token结构
    /// </summary>
    public class AccessTokenInfo
    {

        public AccessTokenInfo(string json)
         : this(JObject.Parse(json))
        {
        }

        private JObject __jobject;
        public AccessTokenInfo(JObject obj)
        {
            this.__jobject = obj;
        }

        public string AccessToken
        {
            get
            {
                return JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "access_token"));
            }
        }

        public int ExpiresIn
        {
            get
            {
                return JsonClassHelper.ReadInteger(JsonClassHelper.GetJToken<JValue>(__jobject, "expires_in"));
            }
        }

    }
}
